$(document).ready(function(){
    $(".loading").css("top",$(window).height() / 2 - 30);
    //displayLoading(true);
    $.post("/manage/getUser",
        function(data){
            if(data.status==1){//登陆成功
                //加载用户信息
                $("#username").val(data.result.username);
            }
            else if(data.status==5){
                alert(data.msg);
                window.location.href="/manage/login.html";
            }
            else{
                alert(data.msg);
            }
            hiddenLoading(true);
        });
    $("#btnSubmit").on("click",function(){
        $(".loading").css("top",$(window).height() / 2 - 30);
        displayLoading(true);
        $.post("/manage/updatePassword",$('#signupForm').serialize(),
            function(data){
                if(data.status==1){//更新成
                    alert(data.msg);
                }
                else if(data.status==5){
                    alert(data.msg);
                    window.location.href="/manage/login.html";
                }
                else{
                    alert(data.msg);
                }
                hiddenLoading(true);
            });

    });
});